package lua

type (
	Statement interface {
	}

	StatList struct {
		stats []Statement
	}

	IfStat struct {
		ifcond       Expr
		ifblock      *StatList
		elseblock    *StatList
		elseifconds  []Expr
		elseifblocks []*StatList
	}

	WhileStat struct {
		cond  Expr
		block *StatList
	}

	DoStat struct {
		block *StatList
	}

	Fornum struct {
		body    *StatList
		varname string
		start   Expr
		limit   Expr
		step    Expr
	}

	Forlist struct {
		body *StatList
		vars []string
		exps *ExprList
	}

	RepeatStat struct {
		cond  Expr
		block *StatList
	}

	FunctionStat struct {
		local bool
		name  []string
		*FuncBody
	}

	LocalStat struct {
		varnames []string
		exps     *ExprList
	}

	LabelStat struct {
		name string
	}

	ReturnStat struct {
		exps *ExprList
	}

	GotoStat struct {
		label string //if s is empty, it is a break else a goto
	}

	AssignStat struct {
		dsts []Expr
		exps []Expr
	}

	//Expression AST
	Expr interface {
	}

	ExprList struct {
		exps []Expr
	}

	NameExpr struct {
		identifier string
	}

	AttrExp struct {
		attribute string
		base      Expr
	}

	IndexExp struct {
		base    Expr
		indexer Expr
	}

	CallExp struct {
		base Expr
		args Expr
	}

	MethodCallExp struct {
		base Expr
		attr string
		args Expr
	}

	FuncBody struct {
		params []string
		body   *StatList
	}

	Constructor struct {
		fields []Expr
	}

	RecField struct {
		attr  Expr
		value Expr
	}

	StrLiteral struct {
		value string
	}

	FloatLiteral struct {
		value float64
	}

	IntLiteral struct {
		value int
	}

	NilLiteral struct {
	}

	BooleanLiteral struct {
		value bool
	}

	DotsLiteral struct {
	}

	BinExpr struct {
		op    int
		left  Expr
		right Expr
	}

	UnaryExpr struct {
		op  int
		exp Expr
	}

	//AST-Visitor
	ASTVisitor interface {
	}
)
